package ExamLab.Test3;

public class A extends Thread {

	public static void doDelay(long t) {

		try {
			Thread.sleep(t);
		} catch (InterruptedException e) {
			System.out.print("Ex-A ");
			e.printStackTrace();
		}

	}

	public void run() {
		doDelay(1000);
		halt();
	}

	public void halt() {

		try {
			this.wait();
		} catch (Exception e) {
			System.out.print("Ex-B ");
			e.printStackTrace();
		}

	}

	public static void main(String args[]) throws Exception {
		A a = new A();
		Thread t = new Thread(a);
		t.start();
		doDelay(100);
		a.interrupt();
		doDelay(2000);
		t.notifyAll();
	}

}